//package com.bwie.config;
//
//import com.bwie.dao.SeckillDao;
//import com.bwie.entity.Seckill;
//import com.bwie.redis.RedisService;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.ApplicationArguments;
//import org.springframework.boot.ApplicationRunner;
//import org.springframework.stereotype.Component;
//
//import java.util.List;
//
//@Component
//public class RedisGoodsStock implements ApplicationRunner {
//
//    @Autowired
//    private SeckillDao seckillDao;
//
//    @Autowired
//    private RedisService redisService;
//
//    @Override
//    public void run(ApplicationArguments args) throws Exception {
//
//        List<Seckill> seckills = seckillDao.list();
//        for (Seckill seckill : seckills) {
//            redisService.setCacheObject("goodsid_num_ch:"+seckill.getShopId(),seckill);
//        }
//        System.out.println("缓存成功");
//    }
//}
